from django.db import models
from django.contrib import admin
from agro.sources import utils
from agro.models import Entry
from django.template import Template

#optional, but useful
import logging

# if importing logging, as suggested, make sure to subclass the logger for easier debugging and cleaner output
log = logging.getLogger('agro.sources.example')

# model definition
class Example(models.Model):
	# needs timestamp, we mirror this to Entry objects, which is how we order Entry output
	timestamp	= DateTimeField()

	class Meta:
		# needs app_label for django to import object def.
		app_label = "agro"
	
	# default format_template, useful for testing entry output without needing to build a template
	def format_template(self):
		return Template("html here")


# admin definition
class ExampleAdmin(admin.ModelAdmin):
	# put some admin options here

# retrieve function
def retrieve():
	# put retreival code here

# don't forget to register this model with Admin
admin.site.register(Example, ExampleAdmin)
